import { createRouter, createWebHashHistory } from 'vue-router';
import base from './base/index';
import NProgress from 'nprogress'
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        ...base,
    ] as any,
});
// 开启进度条
NProgress.configure({ showSpinner: false })   // 显示右上角螺旋加载提示
router.beforeEach((_to: any, _from: any, next: any) => {
    // console.log(to, from)
    NProgress.start()   // 开启进度条
    next();   // 继续路由
})


router.afterEach(() => {
    NProgress.done()
})

export default router;